/*
 *ScoreKeeper class is in charge of keeping track of:
 *strikes, balls, outs, innings and score, hits and errors during a game.
 */
#ifndef SCOREKEEPER_H
#define SCOREKEEPER_H

class ScoreKeeper
{
public:
    ScoreKeeper();
    ~ScoreKeeper();

    int getHomeScore();
    int getAwayScore();
    void addToScore(int runs); //determine who to add runs to by using isBottomHalf();
    int getHomeHits();
    int getAwayHits();
    void incrementHits(); //determine who to add hits to by using isBottomHalf()
    int getHomeErrors();
    int getAwayErrors();
    void addToErrors(int errors); //determine who to add errors to by using isBottomHalf()
    int getStrikes();
    int getBalls();
    int getOuts();
    int getInning();
    bool isBottomHalf();
    void incrementStrikes();
    void incrementBalls();
    void foulBall();
    bool isGameOver();



private:
    //constant values
    int REGULATION_INNINGS;
    int MAX_NUMBER_OF_STRIKES;
    int MAX_NUMBER_OF_BALLS;
    int MAX_NUMBER_OF_OUTS;

    int homeScore;
    int awayScore;
    int homeHits;
    int awayHits;
    int homeErrors;
    int awayErrors;
    int strikes;
    int balls;
    int outs;
    int inning;
    bool bottomHalfOfInning;//needed to know when to increment inning(inning = 2 halves, away team bats, home team bats) bottom of the inning is when the home team bats.

    void incrementOuts();
    void incrementInning();
    void toggleBottomHalf();
    void resetAtBat();
    void resetInning();
};

#endif // SCOREKEEPER_H
